package com.ttg.utils.sm;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import java.io.IOException;

/**
 * 统一使用base64版本，方便维护
 */
public class Base64Util {

    public static String encodeData(byte[] origData){
        return new BASE64Encoder().encode(origData).replace("\r\n","").replace("\n","");
    }

    public static byte[] decodeData(String base64Data) throws IOException {
        return new BASE64Decoder().decodeBuffer(base64Data);
    }
}
